/**
 * Copyright (C), 2020-2020, 软件公司
 * FileName: User
 * Author:   cakin
 * Date:     2020/5/5
 * Description: 用户实体类
 */
package com.cakin.newssystem.core.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;

/**
 * @ClassName: User
 * @Description: 用户实体类
 * @Date: 2020/5/5
 * @Author: cakin
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("user")
public class User {
    /**
     * 用户名
     */
    @NotBlank(message = "用户名不可以为空！")
    @TableField(value = "username")
    private String username;

    /**
     * 密码
     */
    @NotBlank(message = "密码不可以为空！")
    @Pattern(regexp = "^(\\w){8,18}$", message = "密码应为[A-Za-z0-9_]组成的6-18位字符！")
    @TableField(value = "password")
    private String password;
}
